import { effect } from "./effect/effect"
import { reactive } from "./reactive"

const obj = {
  a: 1,
  b: 2,
  c: {
    d: 3
  }
}

const proxy = reactive(obj)

effect(() => {
  console.log('fn1')
  console.log(proxy.a)
})

effect(() => {
  console.log('fn2')
  if (proxy.a === 1) {
    console.log(proxy.b)
  } else {
    console.log(proxy.c.d)
  }
})
proxy.a = 2
proxy.c.d = 4
proxy.b = 5